<div class="row animate fadeIn">
    <form class="form-horizontal" id="subInv_editform">
      <?php foreach($sub_data as $v_subs){?>
        <input type="hidden" name="view_sub_id" id="v_sub_id" value="<?php echo $v_subs->inv_sub_id; ?>"/>
    <div class="ibox-title" style="border:none;"><h5 style="color: #00afef"><i>Edit</i></h5>
        
     </div>
     <div class="ibox-content">
        
            <div class="form-group">
                <label class="col-lg-3 control-label">Sub-Inventory Code</label>
                <div class="col-lg-4">
                    <input type="text" class="form-control" id="" name="" value ="<?php echo $v_subs->inv_sub_code; ?>" readonly>
                </div>
             </div>
             <div class="form-group">
                <label class="col-lg-3 control-label">Sub-Inventory Name</label>
                <div class="col-lg-4">
                    <input type="text" id=""class="form-control" name="" value="<?php echo $v_subs->inv_sub_name; ?>" readonly>
                </div>
            </div>
            <div class="form-group">
                <label class="col-lg-3 control-label">Description</label>
                <div class="col-lg-4">
                    <input type="text" id="" class="form-control" name="" value="<?php echo $v_subs->description; ?>" readonly>
                </div>
            </div>
      </div>
      <?php } ?>
        </form>
        <div id="" class="ibox-content">
            <h3 style="color: #00afef">Sub Locators</h3> 
          
              
            </br>
              <table id=""class="table table-bordered" style="width:80%;">
                <thead>
                    <tr>
                      <th style="">Locator Code</th>
                      <th style="">Description</th>
                    </tr>   
                   
                </thead>
             
                <tbody id="tbl_view_locator" class="animate fadeIn">
                                                
                </tbody>
              </table> 
        </div>




    
 </div>
 <script>
    $(document).ready(function(){
    var hID = $('#v_sub_id').val();
    generate_locators();

    function generate_locators(){
                $.ajax({
                    type: "POST",
                    url: "<?php echo base_url($this->session->userdata('forajax') . '/get_locators_byID'); ?>",
                    data: { "sub_ids" : hID },
                    dataType: 'json',
                    success: function(data){
                        console.log(data);
                        var tmp = "";
                        var trHTML = "";
                         $.each(data, function(i, item) {
                            trHTML += '<tr><td text-align:right; class="">' + data[i].locator_code + '</td><td text-align:right; class="">' + data[i].locator_description + '</td></tr>';
                        });
                        
                        $('#tbl_view_locator').html(trHTML);
                    }
                });
    }

 
      $('#viewX').click(function(){
            close_view();
       });
    });
 </script>  